﻿namespace Test30.Engine
{
    public class FreezeAction : Action
    {
        public FreezeAction(Entity entity, int duration)
            : base(entity)
        {
            _duration = duration;
        }

        protected override ActionResult OnProcess()
        {
            // set the speed
            Entity.Speed.SetBonus(BonusType.Freeze, -3);

            Entity.Conditions.Freeze.AddDuration(_duration);

            return ActionResult.Done;
        }

        private readonly int _duration;
    }
}
